package campus.service.serviceImpl;

import campus.dao.ManagerDao;
import campus.dao.StuDao;
import campus.model.Manager;
import campus.model.Stu;
import campus.service.ManagerService;
import campus.service.StuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Service
public class ManagerServiceImpl implements ManagerService {

    @Resource
    private ManagerDao  managerDao;


    @Override
    public Map<String, Object> loginManager(String managername, String managerpwd) {
        Map<String, Object>  map = new HashMap<String, Object>();
        try {
            int rt=managerDao.loginManager(managername,managerpwd);
            System.out.println(rt);
            map.put("msg","登录成功");
            map.put("code", 1);
        }catch (Exception e){
            map.put("msg","账户或密码错误");
            map.put("code", -1);
        }
        return map;
    }
}
